import request from '@/config/axios'

export interface ProductionIncomingVO {
  id: number
  orderNumber: string
  dictOrderType: number
  customerCode: string
  customerName: string
  productNumber: string
  productName: string
  productStandard: string
  partNumber: string
  partName: string
  partSpecification: string
  orderQuantity: number
  incomingQuantity: number
  dictUnit: number
  incomingType: number
  warehouseCode: string
  warehouseName: string
  creatorName: string
  updaterName: string
}

// 查询生产管理-产品管理-产品入库列表
export const getProductionIncomingPage = async (params) => {
  return await request.get({ url: `/produce/production-incoming/page`, params })
}

// 查询生产管理-产品管理-产品入库详情
export const getProductionIncoming = async (id: number) => {
  return await request.get({ url: `/produce/production-incoming/get?id=` + id })
}

// 新增生产管理-产品管理-产品入库
export const createProductionIncoming = async (data: ProductionIncomingVO) => {
  return await request.post({ url: `/produce/production-incoming/create`, data })
}

// 修改生产管理-产品管理-产品入库
export const updateProductionIncoming = async (data: ProductionIncomingVO) => {
  return await request.put({ url: `/produce/production-incoming/update`, data })
}

// 删除生产管理-产品管理-产品入库
export const deleteProductionIncoming = async (id: number) => {
  return await request.delete({ url: `/produce/production-incoming/delete?id=` + id })
}

// 导出生产管理-产品管理-产品入库 Excel
export const exportProductionIncoming = async (params) => {
  return await request.download({ url: `/produce/production-incoming/export-excel`, params })
}

// 导出生产管理-产品管理-产品入库 Excel
export const enableSimpleAllList= async (params) => {
  return await request.get({ url: `/config/warehouse-archives/enable-simple-all-list`, params})
}

// 生产管理-产品管理-产品入库部件列表
export const getSelectPart = async (params) => {
  return await request.get({ url: `/produce/production-select-part/page`, params})
}
